package com.shell.customer.base.rx;

import com.shell.customer.base.CusInfoModifyEvent;
import com.shell.customer.base.service.CusInfoAprvService;
import com.shell.customer.po.CusAcct;
import com.shell.customer.po.CusInfoAprv;
import com.shell.framework.rx.OnErrorNotImplementedSubscriber;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SaveCusInfoAprvSubscriber extends OnErrorNotImplementedSubscriber<CusInfoModifyEvent<CusAcct>> {
	@Autowired
	private CusInfoAprvService cusInfoAprvService;

	public void onApplicationEvent(CusInfoModifyEvent<CusAcct> event) {
		CusInfoAprv aprv = event.getAprv();

		this.cusInfoAprvService.saveOrUpdate(aprv);
	}
}
